package com.yamanyar.weebill.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.yamanyar.weebill.domain.Attachment;

/**
 * Services for attachment. These services uses data access objects for
 * persistence operations or any kind of calculation that might be needed.
 * Created in Jun 28, 2008.
 * 
 * @author Kaan Yamanyar
 */
public interface AttachmentService {
	/**
	 * Persists given attachment.
	 * 
	 * @param attachment
	 */
	@Transactional
	public void createNew(Attachment attachment);

	/**
	 * Finds all the attachments in the systems.
	 * 
	 * @return All the attachments in the system.
	 */
	public List<Attachment> findAll();

	/**
	 * Find all the attachments with the given name.
	 * 
	 * @param name
	 *            name of the attachment.
	 * @return List of attachments with the given name.
	 */
	public List<Attachment> findByName(String name);

}
